﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DelegateTest1
{
    public partial class ProgressFrm : Form
    {

        public delegate void ChangeProgress(int value);

        public event EventHandler CancalEventHandler;

        public event ChangeProgress ChangeProgressEventHandler;

        public int Maximum { get; set; }

        public int Value { get; set; }

        public ProgressFrm()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 取消
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            CancalEventHandler.Invoke("取消",new EventArgs());
            this.Close();
        }

        private void FunChangeProgress(int value)
        {
            this.progressBar1.Value = value;
        }

        private void FunSetMaxValue(int value)
        {
            this.progressBar1.Maximum = value;
        }

    }
}
